From 33912cf04e8d51d51764d88312c74645237a65a9 Mon Sep 17 00:00:00 2001 From: addshore Date: Mon, 11 Aug 2014 22:22:18 +0100 Subject: [PATCH] Fix visibility in SkinFallback and StubObject Change-Id: Ie4c1aabd966fcdf87a9129ceb59c058740292f2e --- includes/StubObject.php | 20 ++++++++++---------- includes/skins/SkinFallback.php | 6 ++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/includes/StubObject.php b/includes/StubObject.php index 73952da8c5..8878660b73 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -58,7 +58,7 @@ class StubObject { * @param string $class Name of the class of the real object. * @param array $params Parameters to pass to constructor of the real object. */ - function __construct( $global = null, $class = null, $params = array() ) { + public function __construct( $global = null, $class = null, $params = array() ) { $this->global = $global; $this->class = $class; $this->params = $params; @@ -71,7 +71,7 @@ class StubObject { * @param object $obj Object to check. * @return bool True if $obj is not an instance of StubObject class. */ - static function isRealObject( $obj ) { + public static function isRealObject( $obj ) { return is_object( $obj ) && !$obj instanceof StubObject; } @@ -83,7 +83,7 @@ class StubObject { * @param object $obj Object to check. * @return void */ - static function unstub( &$obj ) { + public static function unstub( &$obj ) { if ( $obj instanceof StubObject ) { $obj = $obj->_unstub( 'unstub', 3 ); } @@ -100,7 +100,7 @@ class StubObject { * @param array $args Arguments * @return mixed */ - function _call( $name, $args ) { + public function _call( $name, $args ) { $this->_unstub( $name, 5 ); return call_user_func_array( array( $GLOBALS[$this->global], $name ), $args ); } @@ -109,7 +109,7 @@ class StubObject { * Create a new object to replace this stub object. * @return object */ - function _newObject() { + public function _newObject() { return MWFunction::newObj( $this->class, $this->params ); } @@ -121,7 +121,7 @@ class StubObject { * @param array $args Arguments * @return mixed */ - function __call( $name, $args ) { + public function __call( $name, $args ) { return $this->_call( $name, $args ); } @@ -137,7 +137,7 @@ class StubObject { * @return object The unstubbed version of itself * @throws MWException */ - function _unstub( $name = '_unstub', $level = 2 ) { + public function _unstub( $name = '_unstub', $level = 2 ) { static $recursionLevel = 0; if ( !$GLOBALS[$this->global] instanceof StubObject ) { @@ -170,18 +170,18 @@ class StubObject { */ class StubUserLang extends StubObject { - function __construct() { + public function __construct() { parent::__construct( 'wgLang' ); } - function __call( $name, $args ) { + public function __call( $name, $args ) { return $this->_call( $name, $args ); } /** * @return Language */ - function _newObject() { + public function _newObject() { return RequestContext::getMain()->getLanguage(); } } diff --git a/includes/skins/SkinFallback.php b/includes/skins/SkinFallback.php index 6055473b44..30ea97d995 100644 --- a/includes/skins/SkinFallback.php +++ b/includes/skins/SkinFallback.php @@ -12,14 +12,16 @@ * SkinTemplate class for the fallback skin */ class SkinFallback extends SkinTemplate { - var $skinname = 'fallback', $template = 'SkinFallbackTemplate'; + + public $skinname = 'fallback'; + public $template = 'SkinFallbackTemplate'; /** * Add CSS via ResourceLoader * * @param $out OutputPage */ - function setupSkinUserCss( OutputPage $out ) { + public function setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'mediawiki.skinning.interface' ); } -- 2.20.1